import {useState, useEffect, useCallback, useRef} from 'react'
import { Layout,Row, Col ,message } from 'antd';
import List from './List';
import Side from './Side';
import service from "../lib/service";
const { Content } = Layout;
export default () => {
    const [articleList, setArticleList] = useState([])
    useEffect(() => {
        getArticleList();
    }, [])
    const getArticleList = async () => {
        try {
            let data = {
                page: 1,
                limit: 10
            }
            const result = await service.getArticleList(data);
            console.log(result)
            if (result.data.success == true) {
                setArticleList(result.data.data.records)
            }
        } catch {
            message.error('获取文章列表失败');
        }
    }
    return (
        <Content style={{ padding: '20px 50px' , width:'70%',margin:'auto',background: '#fff'}}>
            <Row gutter={16}>
                <Col className="gutter-row" span={24}>
                    <List/>
                </Col>
                {/*<Col className="gutter-row" span={6}>*/}
                    {/*<Side/>*/}
                {/*</Col>*/}
            </Row>
        </Content>
    )
}